<template>
	<view>
		<view class="feedback_con">
			<textarea placeholder="请输入建议内容..." @input="iContent" :value='content'></textarea>
			<view class="btn" @click="funSubmit">
				{{$t('submit')}}
			</view>
		</view>
		<!--刷新-->
		<view class='loadind_con' v-if="isLoading">
			<view class="loading">
				<view class="loading-bar"></view>
				<view class="loading-bar"></view>
				<view class="loading-bar"></view>
				<view class="loading-bar"></view>
			</view>
		</view>
	</view>
</template>

<script>
	import valid from '../../../static/valid.js';
	
	export default {
		data() {
			return {
				isLoading: false, //是否正在加载
				content: '', //反馈内容
			}
		},
		onLoad() {
			var _this = this;

		},
		methods: {
			funSubmit: function() { //提交
				var _this = this;
				
				//验证
				if (_this.fun_validate(_this.content.isNull(), "请输入反馈内容")) {
					return true;
				}
				_this.isLoading = true;
				_this.fun_request("/Api/Feedback/Create", {
					fb_type: 0,
					fb_content: _this.content
				}, function(res) {
					_this.fun_showToast(res.msg);
					if (res.code == 0) {
						//静态更新
						uni.$emit('load_list_feedback', {
							msg: '页面更新'
						});
						uni.navigateBack();
					}
					_this.isLoading = false;
				});
			},
			iContent(e) { //文本框 - 反馈内容
				this.content = e.detail.value;
			},
			funHref: function(url) { //跳转
				this.fun_navigateTo(url);
			},
		}
	}
</script>

<style>
	page {
		background-color: #F5F6F7;
		padding: 20rpx 3% 30rpx;
	}

	.feedback_con {
		width: 100%;
	}

	.feedback_con textarea {
		width: 94%;
		background-color: #fff;
		height: 450rpx;
		border-radius: 20rpx;
		box-sizing: border-box;
		padding: 20rpx;
		font-size: 30rpx;
	}

	.feedback_con .btn {
		display: block;
		width: 94%;
		background-color: #F85F69;
		height: 90rpx;
		line-height: 90rpx;
		text-align: center;
		color: #fff;
		border-radius: 50rpx;
		margin-top: 40rpx;
		font-size: 32rpx;
	}

	.feedback_result {
		text-align: center;
		width: 94%;
	}

	.feedback_result image {
		border-radius: 50%;
		width: 160rpx;
		height: 160rpx;
		margin: 180rpx 0 40rpx;
	}

	.feedback_result text {
		display: block;
		color: #5E5E5E;
		font-size: 30rpx;
		line-height: 40rpx;
	}

	.feedback_result button {
		margin-top: 120rpx;
		background-color: #F85F69;
		color: #fff;
		width: 60%;
		height: 90rpx;
		line-height: 90rpx;
		border-radius: 50rpx;
		font-size: 34rpx;
	}

	.feedback_result button::after {
		border: 0;
		padding: 0;
		margin: 0;
	}
</style>
